package com.itheima.pattern.composition;


//菜单项：叶子节点
public class Menultem extends MenuComponent{

    public Menultem(String name,int level){
        this.name=name;
        this.level=level;
    }


    public void print(){
        for (int i = 0; i < level; i++) {
            System.out.print("---");
        }
        System.out.println(this.name);
    }
}
